﻿@*YoursLC有源低代码 Create:admin 2023-07-04 14:30:58 添加或编辑-此文件放置于Views/ContractCollection /中*@

@{ ViewBag.Title = "RDLCReport";
    Layout = "~/Areas/Shared/_LayuiForm.cshtml"; }

@*合同收款*@
<form class="layui-form" lay-filter="formUser">
    <input style="display:none" id="_listid" value="@ViewBag.ListId">
    <input style="display:none" id="_userid" value="@ViewBag.UserId">
    <input style="display:none" id="_butAtt" value="@ViewBag.ButAtt">
    <input style="display:none" id="_butPdf" value="@ViewBag.ButPdf">
    <input style="display:none" id="_butDoc" value="@ViewBag.ButDoc">
    <input style="display:none" id="_butExcel" value="@ViewBag.ButExcel">
    <br/>
    <span id="_show" style="text-align: center;"></span>
    <div class="layui-form-item" style="text-align: center;">
        <div class="layui-btn-group">
            <a href="" target="_blank" id="html" class="layui-btn layui-btn-primary layui-btn-sm">打开网页</a>
            <a href="" target="_blank" id="pdf" class="layui-btn layui-btn-primary layui-btn-sm">打开PDF</a>
            <a href="" target="_blank" id="excel" class="layui-btn layui-btn-primary layui-btn-sm">导出Excel</a>
            <a href="" target="_blank" id="doc" class="layui-btn layui-btn-primary layui-btn-sm">导出Doc</a>
            <a href="" target="_blank" id="att" class="layui-btn layui-btn-primary layui-btn-sm">@ViewBag.ButAttTxt</a>
        </div>
    </div>
</form>
<script>
    layui.use(["form"], function () {
        let form = layui.form;
        let layer = layui.layer;

        let $ = layui.$;

        setBut();

        function setBut() {
            
            $("#html").attr("href", "/_TB/GetDetail?listid=" + $('#_listid').val() + "&type=_html&fwid=fw_ContractCollection");

            //附件按钮是否可见
            if ($('#_butAtt').val() == '1') {
                $("#att").attr("href", "/Com/FileManage/AttList?listid=" + $('#_listid').val() + "&fwid=fw_ContractCollection" + "&userid=" + $('#_userid').val());
            }
            else {
                $("#att").hide();
            }

            //PDF按钮是否可见
            if ($('#_butPdf').val() == '1') {
                $("#pdf").attr("href", "/_TB/GetDetail?listid=" + $('#_listid').val() + "&type=pdf&fwid=fw_ContractCollection");
            }
            else {
                $("#pdf").hide();
            }

            //Doc按钮是否可见
            if ($('#_butDoc').val() == '1') {
                $("#doc").attr("href", "/_TB/GetDetail?listid=" + $('#_listid').val() + "&type=doc&fwid=fw_ContractCollection");
            }
            else {
                $("#doc").hide();
            }

            //Excel按钮是否可见
            if ($('#_butExcel').val() == '1') {
                $("#excel").attr("href", "/_TB/GetDetail?listid=" + $('#_listid').val() + "&type=excel&fwid=fw_ContractCollection");
            }
            else {
                $("#excel").hide();
            }

            if ($('#_butExcel').val() != '1' && $('#_butDoc').val() != '1' && $('#_butPdf').val() != '1' && $('#_butAtt').val() != '1') {
                $("#_show").css("display", "block");
                $("#_show").text("可在录入表管理/页面按钮中设置按钮是否显示");
            }
            else {
                $("#_show").css("display", "none");
            }
        }
    });
</script>